home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
IRIX 6.5 Applications 2004 May
/
SGI IRIX 6.5 Applications 2004 May.iso
/
dev
/
java2_dev.idb
/
usr
/
demos
/
java2
/
JNI-invocation-example
/
Makefile.z
/
Makefile
Wrap
Makefile
|
2004-02-24
|
1KB
|
72 lines
#!smake
# Sample Makefile to enable building invocation API example
# Allows selection of ABI (n32 or 64 future) via variable SGI_ABI
# Allows selection of virtual machine (classic or hotspot) via variable VM
#
# Example:
# make SGI_ABI=-n32 VM=hotspot
#
# Default settings of variables (if not specified on command line)
JAVA_HOME ?= /usr/java2
VM ?= hotspot
SGI_ABI ?= -n32
CLASSPATH ?= .
LWOFF ?= -Wl,-woff,85 -Wl,-woff,134
# Set other variables based on those
JAVAC = $(JAVA_HOME)/bin/javac
JAVAH = $(JAVA_HOME)/bin/javah
#if $(SGI_ABI) == "-n32"
LIBDIR = lib32
SUFFIX = n32
#endif
# target rules
#if $(SGI_ABI) == "-n32"
default: all
#else
default:
@echo "This release only supports the -n32 ABI"
#endif
all: run_$(SUFFIX)
Prog.class: Prog.java
$(JAVAC) Prog.java
Prog.h: Prog.class
$(JAVAH) -jni Prog
invoke_$(SUFFIX): invoke.c Prog.h
cc $(SGI_ABI) \
-I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/irix \
invoke.c \
-L$(JAVA_HOME)/$(LIBDIR)/sgi \
-L$(JAVA_HOME)/$(LIBDIR)/sgi/$(VM) \
-L$(JAVA_HOME)/$(LIBDIR)/sgi/native_threads \
-ljvm \
$(LWOFF) \
-o invoke_$(SUFFIX)
run_$(SUFFIX): invoke_$(SUFFIX) Prog.class
export VM=$(VM) ; run_it
clean:
rm -f Prog.h
clobber: clean
rm -f Prog.class invoke_n32 invoke_64